package cn.wyu.blog;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/timeline")
public class TimelineController {

    @Autowired
    private PostDAO postDAO;

    @RequestMapping(value = "/my")
    public ModelAndView my(){
        ModelAndView modelAndView = new ModelAndView("timeline");
        modelAndView.addObject("posts",this.postDAO.list());
        return modelAndView;
    }
}
